#ifndef PAGING_HPP
#define PAGING_HPP

#include <std/cstdint>
#include <std/cstddef>

namespace paging
{
constexpr size_t entriesNumber{1024};
constexpr size_t pageSize{4096};
constexpr size_t pageTableCoverage{entriesNumber * pageSize};
namespace Flags
{
enum Flags : uint32_t
{
	Present        = 1 << 0,
	ReadWrite      = 1 << 1,
	UserSupervisor = 1 << 2,
	WriteTrough    = 1 << 3,
	CacheDisabled  = 1 << 4,
	Accessed       = 1 << 5,
	Dirty          = 1 << 6,
	PageSize       = 1 << 7,
	Global         = 1 << 8,
	OSFlag0        = 1 << 9,
	OSFlag1        = 1 << 10,
	OSFlag2        = 1 << 11,
};

}
class PageTableEntry
{
	public:
		PageTableEntry(void* frameAddress, uint32_t flags);

		void* getFrameAddress() const;
		uint32_t getFlags() const;

	private:
		uint32_t _value;
};
class PageDirectoryEntry
{
	public:
		PageDirectoryEntry(PageTableEntry* pageTable, uint32_t flags);
		PageTableEntry* getPageTableAddress() const;
		uint32_t getFlags() const;
	private:
		uint32_t _value;
};
}

#endif
